package com.pe1n.yangtaopai.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2016/11/21.
 */

public class MyViewPagerAdapter extends FragmentPagerAdapter {

    private String[] TABS;
    private List<Fragment> mList;

    public MyViewPagerAdapter(FragmentManager fm, String[] TABS, List<Fragment> mList) {
        super(fm);
        this.TABS = TABS;
        this.mList = mList;
    }

    @Override
    public Fragment getItem(int position) {
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return TABS[position];
    }

}
